
<!DOCTYPE html>
<html lang="en" class="no-js">

    <head>

        <meta charset="utf-8">
        <title>智能应急快速搭建平台 Login</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">

        <!-- CSS -->
        <link rel="stylesheet" href="/mobile/assets/css/reset.css">
        <link rel="stylesheet" href="/mobile/assets/css/supersized.css">
        <link rel="stylesheet" href="/mobile/assets/css/style.css">

        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
            <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->

    </head>

    <body>

        <div class="page-container">
            <h1>Login</h1>
            <form>
                <input id="username" type="text" name="username" class="username" placeholder="用户名">
                <input id="password" type="password" name="password" class="password" placeholder="密&nbsp;&nbsp;码">
            </form>
                <button onclick="submit()">登录</button>
                <div class="error"><span>+</span></div>
            <div class="connect">
                <p>或者:</p>
                <p>
                    <a class="facebook" href=""></a>
                    <a class="twitter" href=""></a>
                </p>
            </div>
        </div>

        <!-- Javascript -->
        <script src="/mobile/assets/js/jquery-1.8.2.min.js"></script>
        <script src="/mobile/assets/js/supersized.3.2.7.min.js"></script>
        <script src="/mobile/assets/js/supersized-init.js"></script>
        <script src="/mobile/assets/js/scripts.js"></script>
    <script>


        function submit(){
            var url = "";
            if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
                /*window.location.href="你的手机版地址";*/
                url = "/mobile/index.html"
            }
            else {
                /*window.location.href="你的电脑版地址";    */
                url = "/easyui/index.html"
            }


            $.ajax({
                type : "POST",
                async:false,
                url: "/login",
                data:"username="+$('#username').val()+"&password="+$('#password').val(),
                dataType : "json",//数据类型为jsonp
                //jsonp: "callback",//服务端用于接收callback调用的function名的参数
                success: function(callback){
                    window.location.href=url;
                },
                error:function(callback) {
                    window.location.href=url;
                },
            });
        }

    </script>

    </body>

</html>

